package abstractFactory;

public class english_test {
    public static void main(String[]args){
        char a[] = new char[]{'C','A','B','C','D','B','C','B','A','B','D','A','B','C','B','A','B','C','A','D','C','A','D','D','C'};
        int k=0;
        int sum=0;
        int l = 0;
        while(l<4) {
            for (int i = 0; i < 5; i++) {
                for (int j = 0; j < 5; j++) {
                    char c = (char) ((int) (Math.random() * 4) + 'A');
                    if (c == a[k]) {
                        sum++;
                    }
                }
            }
            if(k==24){
                k=0;
            }
            k++;
            l++;
        }
        System.out.println("共答对"+sum+"道题,正确率为"+((double)sum/(4*25))*100+"%");
    }
}
